package cn.com.pg.b2b.pd.truck.appointment.management.service.common;

import org.springframework.http.ResponseEntity;

public class R {
    private R() {
    }

    public static final <T> ResponseEntity<ResponseDTO<T>> success(T object) {
        return ResponseEntity.ok(new ResponseDTO<T>(object));
    }

    public static final <T> ResponseEntity<ResponseDTO<T>> success() {
        return ResponseEntity.ok(new ResponseDTO<T>());
    }

    public static final <T> ResponseEntity<ResponseDTO<T>> error(T data, ReturnCode returnCode) {
        return ResponseEntity.ok(new ResponseDTO<T>(data, returnCode));
    }
}
